package com.palm.hubo2o.ui.fragment;

import android.text.TextUtils;

import com.palm.hubo2o.BaseFragment;
import com.palm.hubo2o.R;
import com.palm.hubo2o.event.CleanLotteryEvent;

import de.greenrobot.event.EventBus;

/**
 * Created by dest1 on 2015/10/8.
 */
public abstract class LotteryFragment extends BaseFragment {
    private String mTitle;


    @Override
    public void onStart() {
        super.onStart();
        EventBus.getDefault().register(this);
    }

    @Override
    public void onStop() {
        EventBus.getDefault().unregister(this);
        super.onStop();
    }


    /**
     * 接收清楚选择事件
     *
     * @param event
     */
    public void onEvent(CleanLotteryEvent event) {
        onClearChoices();
    }

    public void setTitle(String title) {
        this.mTitle = title;
    }

    public String getTitle() {
        if (TextUtils.isEmpty(mTitle))
            return getClass().getName();
        return mTitle;
    }

    @Override
    protected int layoutId() {
        return R.layout.recyclerview;
    }

    protected abstract void onClearChoices();

    public boolean onRandomBalls() {
        return false;
    }


}
